﻿using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using CDFWPUG.Objects;
using System;
using System.Globalization;

namespace CDFWPUG.Converters
{
    public class BooleanToVisibilityConverter : IValueConverter
    {
        public object Convert( object value,
                 Type targetType,
                 object parameter,
                 CultureInfo culture)
             {
                 bool visibility = (bool)value;
                return visibility ? Visibility.Visible : Visibility.Collapsed;
            }
     
            public object ConvertBack(
                object value,
                Type targetType,
                object parameter,
                CultureInfo culture)
            {
                Visibility visibility = (Visibility)value;
                return (visibility == Visibility.Visible);
            }
    }
}
